<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::post('/login', "Api\LoginController@login");
Route::post('/find', "Api\LoginController@find");

Route::post('/register', "Api\RegisterController@register");
Route::get('/sms_code', "Auth\SmsCodeController@send");
Route::get("/config","Api\ProfileController@config");

Route::middleware('refresh.token')->group(function ($router) {
    Route::get('/profile', 'Api\ProfileController@user');
    Route::get('/team', 'Api\TeamController@team');
    Route::get('/team/total', 'Api\TeamController@total');
    Route::get('/profile/code','Api\InCodeController@load');

    Route::post('/fund/buy', "Api\FundController@buy");
    Route::post('/stock/buy', "Api\StockController@buy");
    Route::get('/in_codes', 'Api\InCodeController@index');
    Route::post('/in_codes', 'Api\InCodeController@store');
    Route::get('/fund/logs', 'Api\FundController@logs');
    Route::get('/fund/list', 'Api\FundController@fund');
    Route::get('/fund/detail', 'Api\FundController@month');

    Route::get('/stock/logs', 'Api\StockController@logs');
    Route::get('/stock/list', 'Api\StockController@stock');

    Route::get('/ratio/logs', 'Api\StockController@ratio');
    Route::get('/gift/logs', 'Api\GiftController@index');
    Route::post('/gift/receive', 'Api\GiftController@receive');
    Route::get('/gift/detail', 'Api\GiftController@detail');
    Route::post('/level/update', 'Api\ProfileController@update');

    Route::post('/cash', 'Api\ProfileController@cash');
    Route::get('/cash/logs', 'Api\ProfileController@cash_log');

});
Route::get('/test','Api\ProfileController@test');